package com.crm.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * @ClassName PageDTO
 * @Description
 * @Author 19632
 * @Date 2024/10/8 17:03
 * @Version
 **/
@Data
public class PageDTO {
    //页码
    @ApiModelProperty("分页页码")
    private Integer pageNum;

    //每页显示记录数
    @ApiModelProperty("每页记录数")
    private Integer pageSize;

    private String dictName;
    private String dictType;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime beginCreateTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endCreateTime;
    private String status;
    private Map<String, Object> params;

    public void check() {
        if (pageNum <= 0) {
            pageNum = 1;
        }
        if (pageSize <= 0 || pageSize >= 100) {
            pageSize = 10;
        }
    }
}
